#ifndef PLAYERS_LIST
#define PLAYERS_LIST

#include <game_controller.h>

class Game;
class GameController;
struct PlayerProfile;

class PlayersListItem : public QListViewItem {
public:
	PlayersListItem(QListView * parent);
	~PlayersListItem();

	PlayerProfile * getProfile();
	void setProfile (PlayerProfile * p);
	virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align );

	static int getColumnCount ();
	static QString getColumnText (int i);
	static int getColumnWidth (int i);

protected:
	PlayerProfile * profile;
	static const char * columnsText[5];
	static const int columnWidth[5];
};

class PlayersList : public QListView {
	Q_OBJECT
public:
	PlayersList (GameController * _c, QWidget * parent = 0, const char * name = 0, WFlags f = 0);
	~PlayersList ();

	void reset ();
	void updateList ();
	void setGameController (GameController * _game);
	QSizePolicy sizePolicy() const;
	QSize sizeHint () const;

protected:
	GameController * controller;
};

#endif /* !PLAYERS_LIST */

